# _*_ coding : utf-8 _*_
# @Time : 2022/9/12 15:25
# @Author : 软柠柠吖
# @File : 03-字符串搜索案例
# @Project : pythonProject

import xlrd
from xlutils.copy import copy

wb = xlrd.open_workbook(r'D:\桌面\test\test.xlsx')
ws = wb.sheet_by_name('信息表')

nwb = copy(wb)
nws = nwb.get_sheet('信息表')

for row_num in range(1, ws.nrows):
    txt = ws.cell_value(row_num, 0)
    start = txt.find('（')
    end = txt.find('）')
    nws.write(row_num, 1, txt[start + 1: end])
nwb.save(r'D:\桌面\test\test.xlsx')
